#include "afe_cmd.h"
#include <stdio.h>
#include <stdlib.h>

extern afe_dev_t afe1; // 必须声明外部模拟前端设备

int main(int argc, char *argv[])
{
    int ret = 0;

    if (argc == 2)
    {
        afe1.spi->dp_en = atoi(argv[1]);
    }
    // afe1.spi->dp_en = true;

    ret = afe1.spi->open(); // 必须调用打开spi设备
    if (ret < 0)
    {
        return ret;
    }

    ret = afe_pwr_off(&afe1);
    if (ret != 0)
    {
        printf("afe pwr off failed!\n");
        return ret;
    }
    else
    {
        printf("Bye-Bye!\n");
    }

    return 0;
}